

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	self.Entity.Ent = data:GetEntity()
	self.Entity.Pos = data:GetOrigin()
	
	local emitter = ParticleEmitter( self.Entity.Pos )
	
	for i=1,math.random(1,3) do
		
		local particle = emitter:Add("particles/smokey", self.Entity.Pos + (VectorRand()*math.random(-4,4)))

		particle:SetVelocity(Vector(0,0,-5))
		particle:SetDieTime( math.Rand(.9,1.5) )
		particle:SetStartAlpha( math.random( 50, 100 ) )
		particle:SetEndAlpha(1)
		particle:SetStartSize( math.Rand( 15, 40 ) )
		particle:SetEndSize( math.Rand( 1, 2 ) )
		particle:SetRoll( math.Rand( -95, 95 ) )
		particle:SetRollDelta( math.Rand( -0.12, 0.12 ) )
		local randy = math.random(10,50)
		particle:SetColor( randy,randy,randy ) //lols
		emitter:Finish()
		
	end
	
	for i=1,math.random(1,2) do
		
		local particle = emitter:Add("particles/flamelet"..math.random(1,3), self.Entity.Pos + (VectorRand()*math.random(-2,2)))

		particle:SetVelocity(Vector(0,0,-5))
		particle:SetDieTime( math.Rand(.2,.4) )
		particle:SetStartAlpha( math.random( 60, 100 ) )
		particle:SetEndAlpha(1)
		particle:SetStartSize( math.Rand( 15, 30 ) )
		particle:SetEndSize( math.Rand( 1, 2 ) )
		particle:SetRoll( math.Rand( -95, 95 ) )
		particle:SetRollDelta( math.Rand( -0.12, 0.12 ) )
		particle:SetColor(255, 220, 100)
		emitter:Finish()
		
	end
	
	local rand = math.random(1,55)
	if rand == 6 then
		
		local emitter = ParticleEmitter(self.Entity.Pos)
		local particle = emitter:Add("particles/flamelet"..math.random(1,3), self.Entity.Pos )
		particle:SetVelocity( Vector(math.random(-40,40),math.random(-40,40),math.random(-30,50)) )
		particle:SetDieTime(math.Rand(4,8))
		particle:SetStartAlpha(math.random(140,220))
		particle:SetEndAlpha(20)
		particle:SetStartSize(math.Rand(5,7))
		particle:SetEndSize(0)
		particle:SetRoll(math.random(-200,200))
		particle:SetRollDelta( math.Rand( -1, 1 ) )
		particle:SetColor(255, 220, 100)
		particle:SetGravity(Vector(0,0,-600)) //-600 is normal
		particle:SetCollide(true)
		particle:SetBounce(0.45) 
		emitter:Finish()
	
	end
end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	return false
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()

	// Do nothing - this effect is only used to spawn the particles in Init
	
end



